extern crate cargotest;
extern crate hamcrest;
-use std::path::MAIN_SEPARATOR as SEP;
-
use cargotest::support::{basic_bin_manifest, execs, project, ProjectBuilder};
use hamcrest::{assert_that};
fn verbose_output_for_lib(p: &ProjectBuilder) -> String {
format!("\
[COMPILING] {name} v{version} ({url})
-[RUNNING] `rustc src{sep}lib.rs --crate-name {name} --crate-type lib -g \
+[RUNNING] `rustc src[/]lib.rs --crate-name {name} --crate-type lib -g \
-C metadata=[..] \
--out-dir [..] \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}debug{sep}deps`
+ -L dependency={dir}[/]target[/]debug[/]deps`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-", sep = SEP,
+",
dir = p.root().display(), url = p.url(),
name = "foo", version = "0.0.1")
}
extern crate hamcrest;
use std::env;
-use std::path::MAIN_SEPARATOR as SEP;
use cargotest::is_nightly;
use cargotest::support::{project, execs};
assert_that(p.cargo_process("build").arg("-v"),
execs().with_status(0).with_stderr(&format!("\
[COMPILING] test v0.0.0 ({url})
-[RUNNING] `rustc src{sep}lib.rs --crate-name test --crate-type lib \
+[RUNNING] `rustc src[/]lib.rs --crate-name test --crate-type lib \
-C opt-level=1 \
-C debug-assertions=on \
-C metadata=[..] \
-C rpath \
--out-dir [..] \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}debug{sep}deps`
+ -L dependency={dir}[/]target[/]debug[/]deps`
[FINISHED] debug [optimized] target(s) in [..]
-", sep = SEP,
+",
dir = p.root().display(),
url = p.url(),
)));
assert_that(p.cargo_process("build").arg("-v"),
execs().with_status(0).with_stderr(&format!("\
[COMPILING] test v0.0.0 ({url})
-[RUNNING] `rustc src{sep}lib.rs --crate-name test --crate-type lib \
+[RUNNING] `rustc src[/]lib.rs --crate-name test --crate-type lib \
-g \
-C metadata=[..] \
--out-dir [..] \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}debug{sep}deps`
+ -L dependency={dir}[/]target[/]debug[/]deps`
[FINISHED] [..] target(s) in [..]
-", sep = SEP,
+",
dir = p.root().display(),
url = p.url()
)));
assert_that(p.cargo_process("build").arg("-v"),
execs().with_status(0).with_stderr(&format!("\
[COMPILING] test v0.0.0 ({url})
-[RUNNING] `rustc src{sep}lib.rs --crate-name test --crate-type lib \
+[RUNNING] `rustc src[/]lib.rs --crate-name test --crate-type lib \
-C opt-level={level} \
-g \
-C debug-assertions=on \
-C metadata=[..] \
--out-dir [..] \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}debug{sep}deps`
+ -L dependency={dir}[/]target[/]debug[/]deps`
[FINISHED] [..] target(s) in [..]
-", sep = SEP,
+",
dir = p.root().display(),
url = p.url(),
level = rustc_level
assert_that(p.cargo_process("build").arg("-v").arg("--release"),
execs().with_status(0).with_stderr(&format!("\
[COMPILING] foo v0.0.0 ({url}/foo)
-[RUNNING] `rustc foo{sep}src{sep}lib.rs --crate-name foo \
+[RUNNING] `rustc foo[/]src[/]lib.rs --crate-name foo \
--crate-type dylib --crate-type rlib -C prefer-dynamic \
-C opt-level=1 \
-g \
-C metadata=[..] \
- --out-dir {dir}{sep}target{sep}release{sep}deps \
+ --out-dir {dir}[/]target[/]release[/]deps \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}release{sep}deps`
+ -L dependency={dir}[/]target[/]release[/]deps`
[COMPILING] test v0.0.0 ({url})
-[RUNNING] `rustc src{sep}lib.rs --crate-name test --crate-type lib \
+[RUNNING] `rustc src[/]lib.rs --crate-name test --crate-type lib \
-C opt-level=1 \
-g \
-C metadata=[..] \
--out-dir [..] \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}release{sep}deps \
- --extern foo={dir}{sep}target{sep}release{sep}deps{sep}\
+ -L dependency={dir}[/]target[/]release[/]deps \
+ --extern foo={dir}[/]target[/]release[/]deps[/]\
{prefix}foo[..]{suffix} \
- --extern foo={dir}{sep}target{sep}release{sep}deps{sep}libfoo.rlib`
+ --extern foo={dir}[/]target[/]release[/]deps[/]libfoo.rlib`
[FINISHED] release [optimized + debuginfo] target(s) in [..]
",
dir = p.root().display(),
url = p.url(),
- sep = SEP,
prefix = env::consts::DLL_PREFIX,
suffix = env::consts::DLL_SUFFIX)));
}
extern crate cargotest;
extern crate hamcrest;
-use std::path::MAIN_SEPARATOR as SEP;
-
use cargo::util::paths::dylib_path_envvar;
use cargotest::support::{project, execs, path2url};
use hamcrest::{assert_that, existing_file};
.with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-[RUNNING] `target{sep}debug{sep}foo[EXE]`", dir = path2url(p.root()), sep = SEP))
+[RUNNING] `target[/]debug[/]foo[EXE]`", dir = path2url(p.root())))
.with_stdout("\
hello
"));
[RUNNING] `rustc src[/]lib.rs [..]`
[RUNNING] `rustc src[/]bin[/]a.rs [..]`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-[RUNNING] `target{sep}debug{sep}a[EXE]`", dir = path2url(p.root()), sep = SEP))
+[RUNNING] `target[/]debug[/]a[EXE]`", dir = path2url(p.root())))
.with_stdout("\
hello a.rs
"));
assert_that(p.cargo("run").arg("--bin").arg("b").arg("-v"),
execs().with_status(0)
- .with_stderr(&format!("\
+ .with_stderr("\
[COMPILING] foo v0.0.1 ([..])
[RUNNING] `rustc src[/]bin[/]b.rs [..]`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-[RUNNING] `target{sep}debug{sep}b[EXE]`", sep = SEP))
+[RUNNING] `target[/]debug[/]b[EXE]`")
.with_stdout("\
hello b.rs
"));
.with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-[RUNNING] `target{sep}debug{sep}examples{sep}a[EXE]`", dir = path2url(p.root()), sep = SEP))
+[RUNNING] `target[/]debug[/]examples[/]a[EXE]`", dir = path2url(p.root())))
.with_stdout("\
example
"));
.with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-[RUNNING] `target{sep}debug{sep}main[EXE]`", dir = path2url(p.root()), sep = SEP))
+[RUNNING] `target[/]debug[/]main[EXE]`", dir = path2url(p.root())))
.with_stdout("\
hello main.rs
"));
execs().with_status(0)
.with_stderr(&format!("\
[COMPILING] bar v0.0.1 ({url}/bar)
-[RUNNING] `rustc bar{sep}src{sep}bar.rs --crate-name bar --crate-type lib \
+[RUNNING] `rustc bar[/]src[/]bar.rs --crate-name bar --crate-type lib \
-C opt-level=3 \
-C metadata=[..] \
- --out-dir {dir}{sep}target{sep}release{sep}deps \
+ --out-dir {dir}[/]target[/]release[/]deps \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}release{sep}deps`
+ -L dependency={dir}[/]target[/]release[/]deps`
[COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc examples{sep}a.rs --crate-name a --crate-type bin \
+[RUNNING] `rustc examples[/]a.rs --crate-name a --crate-type bin \
-C opt-level=3 \
-C metadata=[..] \
- --out-dir {dir}{sep}target{sep}release{sep}examples \
+ --out-dir {dir}[/]target[/]release[/]examples \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}release{sep}deps \
- --extern bar={dir}{sep}target{sep}release{sep}deps{sep}libbar.rlib`
+ -L dependency={dir}[/]target[/]release[/]deps \
+ --extern bar={dir}[/]target[/]release[/]deps[/]libbar.rlib`
[FINISHED] release [optimized] target(s) in [..]
-[RUNNING] `target{sep}release{sep}examples{sep}a[EXE]`
+[RUNNING] `target[/]release[/]examples[/]a[EXE]`
",
dir = p.root().display(),
url = path2url(p.root()),
- sep = SEP))
+ ))
.with_stdout("\
fast1
fast2"));
execs().with_status(0)
.with_stderr(&format!("\
[COMPILING] bar v0.0.1 ({url}/bar)
-[RUNNING] `rustc bar{sep}src{sep}bar.rs --crate-name bar --crate-type lib \
+[RUNNING] `rustc bar[/]src[/]bar.rs --crate-name bar --crate-type lib \
-g \
-C metadata=[..] \
- --out-dir {dir}{sep}target{sep}debug{sep}deps \
+ --out-dir {dir}[/]target[/]debug[/]deps \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}debug{sep}deps`
+ -L dependency={dir}[/]target[/]debug[/]deps`
[COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc examples{sep}a.rs --crate-name a --crate-type bin \
+[RUNNING] `rustc examples[/]a.rs --crate-name a --crate-type bin \
-g \
-C metadata=[..] \
- --out-dir {dir}{sep}target{sep}debug{sep}examples \
+ --out-dir {dir}[/]target[/]debug[/]examples \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}debug{sep}deps \
- --extern bar={dir}{sep}target{sep}debug{sep}deps{sep}libbar.rlib`
+ -L dependency={dir}[/]target[/]debug[/]deps \
+ --extern bar={dir}[/]target[/]debug[/]deps[/]libbar.rlib`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-[RUNNING] `target{sep}debug{sep}examples{sep}a[EXE]`
+[RUNNING] `target[/]debug[/]examples[/]a[EXE]`
",
dir = p.root().display(),
url = path2url(p.root()),
- sep = SEP))
+ ))
.with_stdout("\
slow1
slow2"));
execs().with_status(0).with_stderr(&format!("\
[COMPILING] foo v0.0.1 ({dir})
[FINISHED] release [optimized] target(s) in [..]
-[RUNNING] `target{sep}release{sep}foo[EXE]`
+[RUNNING] `target[/]release[/]foo[EXE]`
",
dir = path2url(p.root()),
- sep = SEP)));
+ )));
assert_that(&p.release_bin("foo"), existing_file());
}
assert_that(p.cargo("run").cwd(cwd),
execs().with_status(0)
- .with_stderr(&format!("\
+ .with_stderr("\
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]\n\
-[RUNNING] `.{sep}foo[EXE]`", sep = SEP))
+[RUNNING] `.[/]foo[EXE]`")
.with_stdout("\
hello
"));
extern crate cargotest;
extern crate hamcrest;
-use std::path::MAIN_SEPARATOR as SEP;
-
use cargotest::support::{execs, project};
use hamcrest::assert_that;
.with_status(0)
.with_stderr(format!("\
[COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc src{sep}lib.rs --crate-name foo --crate-type lib -g \
+[RUNNING] `rustc src[/]lib.rs --crate-name foo --crate-type lib -g \
-C metadata=[..] \
--out-dir [..] \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}debug{sep}deps`
+ -L dependency={dir}[/]target[/]debug[/]deps`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-", sep = SEP,
- dir = p.root().display(), url = p.url())));
+", dir = p.root().display(), url = p.url())));
}
#[test]
.with_status(0)
.with_stderr(format!("\
[COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc src{sep}lib.rs --crate-name foo --crate-type lib -g \
+[RUNNING] `rustc src[/]lib.rs --crate-name foo --crate-type lib -g \
-C debug-assertions=off \
-C metadata=[..] \
--out-dir [..] \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}debug{sep}deps`
+ -L dependency={dir}[/]target[/]debug[/]deps`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-", sep = SEP,
- dir = p.root().display(), url = p.url())))
+", dir = p.root().display(), url = p.url())))
}
#[test]
.with_status(0)
.with_stderr(&format!("\
[COMPILING] {name} v{version} ({url})
-[RUNNING] `rustc src{sep}lib.rs --crate-name {name} --crate-type lib -g \
+[RUNNING] `rustc src[/]lib.rs --crate-name {name} --crate-type lib -g \
-C metadata=[..] \
--out-dir [..] \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}debug{sep}deps`
-[RUNNING] `rustc src{sep}main.rs --crate-name {name} --crate-type bin -g \
+ -L dependency={dir}[/]target[/]debug[/]deps`
+[RUNNING] `rustc src[/]main.rs --crate-name {name} --crate-type bin -g \
-C debug-assertions \
-C metadata=[..] \
--out-dir [..] \
--emit=dep-info,link \
- -L dependency={dir}{sep}target{sep}debug{sep}deps \
- --extern {name}={dir}{sep}target[/]debug[/]deps[/]lib{name}.rlib`
+ -L dependency={dir}[/]target[/]debug[/]deps \
+ --extern {name}={dir}[/]target[/]debug[/]deps[/]lib{name}.rlib`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-", sep = SEP,
+",
dir = p.root().display(), url = p.url(),
name = "foo", version = "0.0.1")));
}
.with_status(0)
.with_stderr(format!("\
[COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc src{sep}lib.rs --crate-name foo --crate-type lib -g \
+[RUNNING] `rustc src[/]lib.rs --crate-name foo --crate-type lib -g \
-C metadata=[..] \
--out-dir [..]`
-[RUNNING] `rustc src{sep}bin{sep}bar.rs --crate-name bar --crate-type bin -g \
+[RUNNING] `rustc src[/]bin[/]bar.rs --crate-name bar --crate-type bin -g \
-C debug-assertions [..]`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-", sep = SEP, url = p.url())));
+", url = p.url())));
}
#[test]
.with_status(0)
.with_stderr(format!("\
[COMPILING] foo v0.0.1 ({url})
-[RUNNING] `rustc src{sep}lib.rs --crate-name foo --crate-type lib -g \
+[RUNNING] `rustc src[/]lib.rs --crate-name foo --crate-type lib -g \
-C metadata=[..] \
--out-dir [..]`
-[RUNNING] `rustc tests{sep}bar.rs --crate-name bar -g \
+[RUNNING] `rustc tests[/]bar.rs --crate-name bar -g \
-C debug-assertions [..]--test[..]`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-", sep = SEP, url = p.url())));
+", url = p.url())));
}
#[test]
[COMPILING] foo v0.0.1 ({url})
[RUNNING] `[..] -g -C debug-assertions [..]`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-",
- url = foo.url())));
+", url = foo.url())));
}
#[test]
extern crate cargotest;
extern crate hamcrest;
-use std::path::MAIN_SEPARATOR as SEP;
-
use cargotest::support::{execs, project};
use hamcrest::{assert_that};
.with_status(0)
.with_stderr(format!("\
[DOCUMENTING] foo v0.0.1 ({url})
-[RUNNING] `rustdoc src{sep}lib.rs --crate-name foo \
- -o {dir}{sep}target{sep}doc \
- -L dependency={dir}{sep}target{sep}debug{sep}deps`
+[RUNNING] `rustdoc src[/]lib.rs --crate-name foo \
+ -o {dir}[/]target[/]doc \
+ -L dependency={dir}[/]target[/]debug[/]deps`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-", sep = SEP,
- dir = p.root().display(), url = p.url())));
+", dir = p.root().display(), url = p.url())));
}
#[test]
.with_status(0)
.with_stderr(format!("\
[DOCUMENTING] foo v0.0.1 ({url})
-[RUNNING] `rustdoc src{sep}lib.rs --crate-name foo \
- -o {dir}{sep}target{sep}doc \
+[RUNNING] `rustdoc src[/]lib.rs --crate-name foo \
+ -o {dir}[/]target[/]doc \
--no-defaults \
- -L dependency={dir}{sep}target{sep}debug{sep}deps`
+ -L dependency={dir}[/]target[/]debug[/]deps`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-", sep = SEP,
- dir = p.root().display(), url = p.url())));
+", dir = p.root().display(), url = p.url())));
}
.with_status(0)
.with_stderr(format!("\
[COMPILING] bar v0.0.1 ([..])
-[RUNNING] `rustc [..]bar{sep}src{sep}lib.rs [..]`
+[RUNNING] `rustc [..]bar[/]src[/]lib.rs [..]`
[DOCUMENTING] foo v0.0.1 ({url})
-[RUNNING] `rustdoc src{sep}lib.rs --crate-name foo \
- -o {dir}{sep}target{sep}doc \
+[RUNNING] `rustdoc src[/]lib.rs --crate-name foo \
+ -o {dir}[/]target[/]doc \
--no-defaults \
- -L dependency={dir}{sep}target{sep}debug{sep}deps \
+ -L dependency={dir}[/]target[/]debug[/]deps \
--extern [..]`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-", sep = SEP,
- dir = foo.root().display(), url = foo.url())));
+", dir = foo.root().display(), url = foo.url())));
}
#[test]
.with_status(0)
.with_stderr(format!("\
[DOCUMENTING] bar v0.0.1 ([..])
-[RUNNING] `rustdoc [..]bar{sep}src{sep}lib.rs --crate-name bar \
- -o {dir}{sep}target{sep}doc \
+[RUNNING] `rustdoc [..]bar[/]src[/]lib.rs --crate-name bar \
+ -o {dir}[/]target[/]doc \
--no-defaults \
- -L dependency={dir}{sep}target{sep}debug{sep}deps`
+ -L dependency={dir}[/]target[/]debug[/]deps`
[FINISHED] debug [unoptimized + debuginfo] target(s) in [..]
-", sep = SEP,
- dir = foo.root().display())));
+", dir = foo.root().display())));
}